<template>
    <div>
        <van-sticky>
            <van-nav-bar title="缴费" left-text="返回" left-arrow @click-left="onClickLeft" />
        </van-sticky>
        <van-form @submit="onSubmit">
            <van-field v-model="billNo" name="billNo" label="账单号" placeholder="输入账单号" />
            <van-field v-model="paymentNo" name="paymentNo" label="缴费编号" placeholder="请输入缴费编号" />
            <van-field v-model="paymentType" name="paymentType" label="支付方式" placeholder="支付宝,电子钱包,微信" />
            <div style="margin: 16px;">
                <van-button round block type="info" native-type="submit">缴费</van-button>
            </div>
        </van-form>
    </div>
</template>
<script>
import nav from "@/mixin/nav"
import { payAdd } from "@/service/living/linvingService";
export default {
    mixins: [nav],
    data() {
        return {
            billNo: "",
            paymentNo: "",
            paymentType: ""
        }
    },
    methods: {
        onClickLeft() {
            this.$router.go(-1);
        },
        async onSubmit(val) {
            console.log(val);
            let { data } = await payAdd(val);
            console.log(data);
            if (data.code == 200) {
                this.$toast.success("缴费成功!");
                this.$router.push("/living");
            }
        }
    }
}

</script>